<html>
<body>

<h4>Total Reviews</h4>
{{ total_reviews.value }}

<h4>Reviews by date</h4>
<dl>
{% for stat in reviews_by_date %}
    <dt>{{ stat.get_dimension_value('date') }}</dt>
    <dd>
        {{ stat.value }}
        {% set avg_rating = average_rating_by_date_map.get(stat.get_dimension_value('date')) %}
        (average rating:
            {% if avg_rating is not none -%}
                {{ '%5.2f'|format(avg_rating) }}
            {%- else -%}
                N/A
            {%- endif -%}
        )
    </dd>
{% endfor %}
</dl>

<h4>Reviews for "service"</h4>
<dl>
{% for stat in rating_counts_for_service %}
    <dt>{{ stat.get_dimension_value('rating') }}-star</dt>
    <dd>{{ stat.value }}</dd>
{% endfor %}
</dl>

<h4>Reviews for "food"</h4>
<dl>
{% for stat in rating_counts_for_food %}
    <dt>{{ stat.get_dimension_value('rating') }}-star</dt>
    <dd>{{ stat.value }}</dd>
{% endfor %}
</dl>

<p>
    <b>Now, go check out <a href="/_ah/stats">appstats</a> to make sure the queries ran in parallel.</b>
</p>

</body>
</html>
